package com.ax.center.config;

import com.ax.center.enumeration.ExportFormat;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

/**
 * @author zy
 * @date 2023/7/13 14:53
 */
@Component
public class ExportFormatConverter implements Converter<String, ExportFormat> {

    @Override
    public ExportFormat convert(String source) {
        try {
            return ExportFormat.valueOf(source.toUpperCase());
        } catch (IllegalArgumentException ex) {

            return null;
        }
    }
}
